<?php
class Web_View_Helper_CommerceScheduleToday
	extends Zend_View_Helper_Abstract 
{
	
	public function commerceScheduleToday( $negocio, $label = true ) 
	{

		if( $negocio->abreHoy()){
				
				
			$horariosHoy = $negocio->horariosHoy();
			
			$desde = $horariosHoy[0]->desde();
			$hasta = $horariosHoy[0]->hasta();
			
			$text = sprintf(	$this->view->translate('scheduleToday'), 
							ucfirst($desde->toString(Zend_Date::WEEKDAY)), 
							$desde->toString(Zend_Date::TIME_SHORT), 
							$hasta->toString(Zend_Date::TIME_SHORT)
						);
	
			if ( isset( $horariosHoy[1] )){
			
				$desde = $horariosHoy[1]->desde();
				$hasta = $horariosHoy[1]->hasta();
				
				$text.= sprintf(	$this->view->translate('scheduleTodayAnd'),
								$desde->toString(Zend_Date::TIME_SHORT), 
								$hasta->toString(Zend_Date::TIME_SHORT)
							);
	
			
			}			
						
						
		} else {
			$text = $this->view->translate('closedToday');
		}
		
		if ( $label ) {
		    return "<p class='hours'>". $this->view->translate('schedules') .": <span>{$text}</span></p>";
		} 
		
		//<p class="hours">Horarios: <span>Hoy de 12:00 a 15:00</span></p>
		return "<p class='hours'><span>{$text}</span></p>";
	}

}